package com.ideaaedi.springcloud.jd.yourbiz.feignclient;


import com.ideaaedi.springcloud.jd.commonds.entity.PageInfo;
import com.ideaaedi.springcloud.jd.commonds.entity.Result;
import com.ideaaedi.springcloud.jd.commonds.entity.user.vo.req.SysMenuListReqVO;
import com.ideaaedi.springcloud.jd.commonds.entity.user.vo.resp.SysMenuDetailRespVO;
import com.ideaaedi.springcloud.jd.commonds.entity.user.vo.resp.SysMenuListRespVO;
import com.ideaaedi.springcloud.jd.commonspring.config.FeignClientConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * 调用user微服务 'jd-user'为要调用的微服务的名称
 *
 * @author <font size = "20" color = "#3CAA3C"><a href="https://gitee.com/JustryDeng">JustryDeng</a></font> <img
 * src="https://gitee.com/JustryDeng/shared-files/raw/master/JustryDeng/avatar.jpg" />
 * @since 2021.0.1.A
 */
@FeignClient(name = "jd-user", configuration = {FeignClientConfig.class})
public interface UserFeignClient {

    /**
     * oauth登录（获取或刷新token）
     *
     * @param param 参数
     *
     * @return token信息
     */
    @PostMapping(value = "/oauth/token")
    String createToken(@RequestParam Map<String, Object> param);
    
    
    /**
     * 列表
     *
     * @param req 参数
     *
     * @return 菜单列表
     */
    @PostMapping("/sys-menu/list")
    Result<PageInfo<SysMenuListRespVO>> list(@RequestBody SysMenuListReqVO req);
    
    /**
     * 查详情
     *
     * @param id 要查询数据的id
     *
     * @return 数据详情
     */
    @GetMapping(value = "/sys-menu/detail/{id}")
    Result<SysMenuDetailRespVO> detail(@PathVariable("id") Long id);
}
